﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeBoundedPlane : OdGePlanarEnt
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeBoundedPlane(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeBoundedPlane_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeBoundedPlane obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeBoundedPlane()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeBoundedPlane(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeBoundedPlane() : this(GlobalsPINVOKE.new_OdGeBoundedPlane__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundedPlane(OdGeBoundedPlane plane) : this(GlobalsPINVOKE.new_OdGeBoundedPlane__SWIG_1(OdGeBoundedPlane.getCPtr(plane)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundedPlane(OdGePoint3d origin, OdGeVector3d uAxis, OdGeVector3d vAxis) : this(GlobalsPINVOKE.new_OdGeBoundedPlane__SWIG_2(OdGePoint3d.getCPtr(origin), OdGeVector3d.getCPtr(uAxis), OdGeVector3d.getCPtr(vAxis)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeBoundedPlane(OdGePoint3d uPnt, OdGePoint3d origin, OdGePoint3d vPnt) : this(GlobalsPINVOKE.new_OdGeBoundedPlane__SWIG_3(OdGePoint3d.getCPtr(uPnt), OdGePoint3d.getCPtr(origin), OdGePoint3d.getCPtr(vPnt)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool intersectWith(OdGePlane plane, OdGeLine3d intLine, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeBoundedPlane_intersectWith__SWIG_0(this.swigCPtr, OdGePlane.getCPtr(plane), OdGeLine3d.getCPtr(intLine), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGePlane plane, OdGeLine3d intLine)
		{
			bool result = GlobalsPINVOKE.OdGeBoundedPlane_intersectWith__SWIG_1(this.swigCPtr, OdGePlane.getCPtr(plane), OdGeLine3d.getCPtr(intLine));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeBoundedPlane plane, OdGeLineSeg3d intLine, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeBoundedPlane_intersectWith__SWIG_2(this.swigCPtr, OdGeBoundedPlane.getCPtr(plane), OdGeLineSeg3d.getCPtr(intLine), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeBoundedPlane plane, OdGeLineSeg3d intLine)
		{
			bool result = GlobalsPINVOKE.OdGeBoundedPlane_intersectWith__SWIG_3(this.swigCPtr, OdGeBoundedPlane.getCPtr(plane), OdGeLineSeg3d.getCPtr(intLine));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundedPlane set(OdGePoint3d origin, OdGeVector3d uAxis, OdGeVector3d vAxis)
		{
			OdGeBoundedPlane result = new OdGeBoundedPlane(GlobalsPINVOKE.OdGeBoundedPlane_set__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(origin), OdGeVector3d.getCPtr(uAxis), OdGeVector3d.getCPtr(vAxis)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundedPlane set(OdGePoint3d uPnt, OdGePoint3d origin, OdGePoint3d vPnt)
		{
			OdGeBoundedPlane result = new OdGeBoundedPlane(GlobalsPINVOKE.OdGeBoundedPlane_set__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(uPnt), OdGePoint3d.getCPtr(origin), OdGePoint3d.getCPtr(vPnt)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeBoundedPlane Assign(OdGeBoundedPlane plane)
		{
			OdGeBoundedPlane result = new OdGeBoundedPlane(GlobalsPINVOKE.OdGeBoundedPlane_Assign(this.swigCPtr, OdGeBoundedPlane.getCPtr(plane)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
